<?php
header("Content-type: text/html; charset=utf-8");
require_once('config.php');

if($_POST)
{
	$username = $_POST['username'];
	$address = $_POST['address'];
	$phone = $_POST['phone'];
	$tel = $_POST['tel'];
	$zip = $_POST['zip'];
	$code = $_POST['code'];
	$pay_way = $_POST['pay_way'];
	$msg = $_POST['msg'];

	$t = time();
	$sql = "INSERT INTO `yan_dingdan`.`ainuoken` (`username`, `address`, `phone`, `tel`, `zip`, `code`, `pay_way`, `msg`, `add_time`) VALUES ('$username', '$address', '$phone', '$tel', '$zip', '$code', '$pay_way', '$msg', $t);";
	$res = mysql_query($sql);
	if(!$res)
	{
		echo mysql_error();
	}
	else
	{
		echo '<script>alert("订单提交成功！");history.go(-1);</script>';
	}
}

include "index.html";
?>
